package com.hedl.practice.diyJava.io.study_reader.test;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) throws IOException {
        try(Reader reader = new FileReader("/Users/a101/idea/人应该懂得放弃.txt",StandardCharsets.UTF_8)){
            char[] buffer = new char[1000];
            int n;
            while((n = reader.read(buffer)) != -1){
                System.out.println("read "+ n + "chars.");
            }
        }
    }
}
